home *** CD-ROM | disk | FTP | other *** search
/ Nebula 2 / Nebula Two.iso / Graphics / PostScript / Scott / hslide.ps next >
Text File  |  1995-06-12  |  4KB  |  130 lines

  1. %% hslide.ps
  2. %%
  3. %% Written April 29, 1990,
  4. %% Scott Hess
  5. %% NeXT Campus Consultant
  6. %% Gustavus Adolphus College
  7. %% St. Peter, Mn    56082
  8. %% scott@gacvax1.bitnet
  9. %%
  10. %% This program slides the bottom section of the Workspace off the screen to
  11. %% the right, drops the rest to cover that area, and loops until the whole
  12. %% screen is gone.
  13.  
  14. %% This file may be installed so that the Scene application will bring it up
  15. %% under the Movies menu.  To do this, create a directory within the
  16. %% /NextLibrary/Images/Scene_movies directory named hslide.movie.  Inside this
  17. %% directory, place this file, with the name hslide.script.ps.  Then, run
  18. %% Scene, and there you are.  This really belongs in the /LocalLibrary
  19. %% directory, but unfortunately, Scene will not find it there.  Sad, eh?
  20.  
  21. %% This code is freely released into the public domain.  You may cut/paste,
  22. %% slash, rearrange, remove comments, and otherwise mutilate this code
  23. %% with no fear of reprisal from myself.  So, go ahead!  I want to see more
  24. %% screen hacks, people!
  25.  
  26. %% scott
  27.  
  28. %% Grab the Workspace and draw it in the passed window.
  29. /getWorkspace    % window
  30. {
  31.   gstate /dest exch def
  32.   /tempwin 0 0 1120 832 Nonretained window def
  33.   tempwin windowdeviceround
  34.   /tgs gstate def
  35.  
  36.   false tempwin setautofill
  37.   Above 0 currentwindow orderwindow
  38.  
  39.   dest setgstate 0 0 1120 832 tgs 0 0 Copy composite
  40.   tempwin termwindow
  41. } def
  42.  
  43. %% Move a region of the current gstate.
  44. /shift            %% x y w h dx dy
  45. {
  46.   4 index add
  47.   exch 5 index add
  48.   exch
  49.   gstate
  50.   3 1 roll
  51.   Copy composite
  52. } def
  53.  
  54. %% Return after mouseclick accepted.
  55. /waitmouse
  56. {
  57.   { buttondown {exit} if} loop
  58.   { stilldown not {exit} if} loop
  59. } def
  60.  
  61. gsave
  62.   %% get a window the size of the Workspace.
  63.   /win 0 0 1120 832 Buffered window def
  64.   win windowdeviceround
  65.  
  66.   currentwindow getWorkspace
  67.  
  68.   %% Move the psuedo-Workspace to the front.
  69.   Above 0 win orderwindow
  70.  
  71.   %% How fast to shift.  Not really needed, now.
  72.   /shiftby 4 def
  73.   
  74.   0.0 setgray                %% leave behind Black
  75.   32                    %% 32 strips of 26 pixels high.
  76.     {
  77.       0 0 1120 26 shiftby 0 shift    %% shift the strip to the right.
  78.       0 0 shiftby 26 rectfill        %% and fill in the opened area.
  79.       flushgraphics            %% flush that.
  80.       shiftby shiftby 1120        %% shift all the way across.
  81.     {
  82.       pop                %% forget that number.
  83.       0 0 1120 26 shiftby 0 shift    %% shift the strip to the right.
  84.                     %% (don't have to fill in opened
  85.                     %% area anymore :-)
  86.       flushgraphics            %% flush the output.
  87.       buttondown {exit} if        %% if button is down, leave.
  88.     } for
  89.       buttondown {exit} if        %% get out right away in case of button.
  90.       0 0 1120 832 0 -26 shift        %% drop the rest of the screen.
  91.       0 806 1120 26 rectfill        %% fill in the top.  Note that the
  92.                     %% same thing as above could be
  93.                     %% done, just not so easy, now.
  94.       (../../../NextLibrary/Sounds/Bonk.snd) 1 playsound
  95.                     %% Bonk.
  96.       flushgraphics            %% make sure the user sees it!.
  97.       buttondown {exit} if        %% could have been a buttondown in there.
  98.     }
  99.   repeat
  100.   waitmouse                %% wait for that buttondown.
  101.  
  102.   win termwindow            %% get rid of the window.
  103. grestore
  104.  
  105. rkspace and draw it in the passed window.
  106. /getWorkspace    % window
  107. {
  108.   gstate /dest exch def
  109.   /tempwin 0 0 1120 832 Nonretained window def
  110.   tempwin windowdeviceround
  111.   /tgs gstate def
  112.  
  113.   false tempwin setautofill
  114.   Above 0 currentwindow orderwindow
  115.  
  116.   dest setgstate 0 0 1120 832 tgs 0 0 Copy composite
  117.   tempwin termwindow
  118. } def
  119.  
  120. %% Move a region of the current gstate.
  121. /shift            %% x y w h dx dy
  122. {
  123.   4 index add
  124.   exch 5 index add
  125.   exch
  126.   gstate
  127.   3 1 roll
  128.   Copy composite
  129. } def
  130.